const net = require('net')

const server = net.createServer(socket => {
  socket.end('goodbye\n')
}).on('error', err => {
  throw err
})

server.listen(1337, 'localhost', () => {
  console.log('opened server on', server.address())
})
